﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="config.aspx.cs" Inherits="UI.system.page.config.config" %>
<%@ Import Namespace="Common" %>
<script src="/js/jquery.min.js"></script>
<script src="/js/common.js"></script>
<script src="/js/md5.js"></script>
<script src="/js/swfupload.js"></script>
<script src="/system/js/admin.js"></script>
<script src="/system/layui/layui.js"></script>
<link rel="stylesheet" href="/system/layui/css/layui.css">
<link rel="stylesheet" href="/system/css/iframe.css">
<div style="margin: 35px;">
	<form class="layui-form" style="padding-left:0px;">
        <div class="layui-form-item">
			<label class="layui-form-label">AppId</label>
			<div class="layui-input-block" style="width:400px;">
				<input id="appid" placeholder="请输入AppId" lay-verify="required" autocomplete="off" class="layui-input" value="<%=info.AppId%>">
			</div>
		</div>
        <div class="layui-form-item">
			<label class="layui-form-label">AppSecret</label>
			<div class="layui-input-block" style="width:400px;">
				<input id="appsecret" placeholder="请输入AppSecret" lay-verify="required" autocomplete="off" class="layui-input" value="<%=info.AppSecret%>">
			</div>
		</div>
        <div class="layui-form-item">
			<label class="layui-form-label">商户号</label>
			<div class="layui-input-block" style="width:400px;">
				<input id="mchid" placeholder="请输入商户号" lay-verify="required" autocomplete="off" class="layui-input" value="<%=info.MchId%>">
			</div>
		</div>
        <div class="layui-form-item">
			<label class="layui-form-label">支付秘钥</label>
			<div class="layui-input-block" style="width:400px;">
				<input id="appkey" placeholder="请输入支付秘钥" lay-verify="required" autocomplete="off" class="layui-input" value="<%=info.AppKey%>">
			</div>
		</div>
        <div class="layui-form-item">
			<label class="layui-form-label">1元可抵</label>
			<div class="layui-input-block" style="width:400px;">
                <div class="lefts"><input id="score" placeholder="请输入可抵积分" lay-verify="required" autocomplete="off" class="layui-input" value="<%=info.Score%>" style="width:350px"></div>
				<div class="floats">分</div>
			</div>
		</div>
        <div class="layui-form-item">
			<label class="layui-form-label"></label>
			<div class="layui-input-inline">
				<a lay-filter="save" class="layui-btn layui-btn-small" onclick="Update_Config()">保存</a>
			</div>
		</div>
	</form>
</div>
<script>
    function Update_Config() {
        var data = {};
        data.act = "Update_Config";
        data.appid = $("#appid").val();
        data.appsecret = $("#appsecret").val();
        data.mchid = $("#mchid").val();
        data.appkey = $("#appkey").val();
        data.score = $("#score").val();
        data.sign = GetSign(data.act);
        LayerBox.Loading();
        Ajax.Post("/tools/Admin.ashx", data, function (r) {
            LayerBox.Close.ByAll();
            var json = $.parseJSON(r);
            if (json.state) {
                LayerBox.Success("保存成功");
            }
            else {
                LayerBox.Error(json.msg);
            }
        });
    };
</script>